package org.zdp.demo.config.okhttp;


import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;


@Data
@ConfigurationProperties(prefix = OkHttpProperties.PREFIX)
public class OkHttpProperties {

    public static final String PREFIX = "ok.http";

    private boolean enable;

    private boolean logger;

    private Proxy proxy;

    private Http http;


    @Data
    public static class Proxy {
        private boolean enable;

        private String host;

        private Integer port;
    }

    @Data
    public static class Http {
        private Long connectTimeout;

        private Long readTimeout;

        private Long writeTimeout;

        private Long callTimeout;

        private Integer maxIdleConnections;

        private Long keepAliveDuration;

        private Integer maxRetryCount = 0;

    }

}
